﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<VietImage.Models.Category>" %>
<%@ Register Src="~/Views/Category/Image.ascx" TagName="image" TagPrefix="uc" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
  <%
      int lang = (int)ViewData["Language"];
 %>

 <%=  Model.GetDetail(lang).Name %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 <%
     int lang = (int)ViewData["Language"];
 %>


<div id="Detail" style="clear:both;">

    <div>

        <div id="direction" style="width:400px; float:left; padding-top:15px;">
            <div class="right-arrow"></div>
            <div style="font-size:14px; float:left;"><%= Html.ActionLink("THƯ VIỆN ẢNH","Index","Category") %></div>
            <div class="right-arrow"></div>
            <div style="font-size:14px; float:left;"><%= Html.ActionLink(Model.Parents[0].GetDetail(lang).Name, "Index", "Category", new { id = Model.Parents[0].ID }, null)%></div>
            <div class="right-arrow"></div>
            <div style="font-size:14px; float:left;"><%= Html.ActionLink(Model.GetDetail(lang).Name, "Detail", "Category", new { id = Model.ID }, null)%></div>
        </div>
        <div id="searchTool" style="width:600px; float:right;">
            <table border="0" cellspacing="5" cellpadding="5" style="float:right;">
                <tr>
                    <td>
                        <table cellpadding="0" cellspacing="0" border="0">
	                        <tr class="tr-textbox">    
    	                        <td class="left-textbox"></td>
                                <td class="center-textbox"><input value="Từ khóa ..." size="40" onfocus="textboxsearchonfocus(this);" onblur="textboxsearchonblur(this);" name="txtSearch" type="text" class="search-textbox"/></td>
    	                        <td class="right-textbox"></td>    
                            </tr>
                        </table>
                    </td>
                    <td>
                        <div style="cursor:pointer;" onmouseout="buttonmouseout('Search');" onmousedown="buttonmousedown('Search');" onmouseover="buttonmouseover('Search');"><table cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td id="lbtnSearch" class="left-button"></td>
                                <td id="mbtnSearch" class="middle-button"><span style="color:White;">TÌM KIẾM</span></td>
                                <td id="rbtnSearch" class="right-button"></td>                        
                            </tr>          
                        </table></div>                    
                    </td>
                    <td class="horizontalborder-twoline"></td>
                    <td style="font-size:14px"><div style="cursor:pointer"><i><%=Html.ActionLink("Tìm kiếm nâng cao", "Index", "Search") %></i></div></td>
                </tr>
            </table>
        
        </div>
    </div>

    <div id="Gallery" style="clear:both; width:1000px; position:relative; left:50%; margin-left:-500px; padding-top:30px; ">
        
        <div class="scrollbar2" style=" clear:both; width: 1000px; height:500px; margin-top:-10px;">
            <div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
            <div class="viewport" id="viewport" style="width: 1000px; height:500px; margin-top:50px;">

<% 
    VietImage.Models.Image img = new VietImage.Models.Image();
    Double h = 0;
    int count = 0;
    if (Model.Images != null)
    {
        count = Model.Images.Count;
        h = ((Double)count / 2) + 0.5;
    }
    int itemwidth = 200;
    int half = (int)h;
    //half = 15;
%>
                <div class="overview" style="<%= "width:" + half * itemwidth + "px;" %>">
<% 
    for (int i = 0; i < count; )
    {
        img1.ViewData["Image"] = Model.Images[i++];
%>
                    <div style="float:left;">
                    <uc:image ID="img1" runat="server" />

<%
        if (i < count)
        {
            img2.ViewData["Image"] = Model.Images[i++];
%>
                    <uc:image ID="img2" runat="server" />
<%
        } 
%>
                    </div>
<%
    }
%>

                     <div style="float:left;">



                     </div>
                </div>
            </div>
        </div>

    </div>

</div>


</asp:Content>
